package com.servlet; /**
 * @author wzm
 * @create 2023-03-01 15:43
 */

import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;

@WebServlet("/hello02")
public class Servlet02 implements Servlet {

    //1.创建Servlet对象
    public Servlet02(){
        System.out.println("Servlet对象创建了");
    }

    //2.Servlet初始化
    @Override
    public void init(ServletConfig config) throws ServletException {
        System.out.println("Servlet初始化完成");
    }

    //获取Servlet配置文件
    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    //3.处理请求和响应
    @Override
    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
        System.out.println("Servlet的service完成他的工作");
    }

    //获取Servlet的相关信息
    @Override
    public String getServletInfo() {
        return null;
    }

    //4.销毁Servlet
    @Override
    public void destroy() {
        System.out.println("Servlet销毁了");
    }
}
